1. Module (chicken process signal)
    1. set-alarm!
    2. signal-handler
    3. set-signal-handler!
    4. set-signal-mask!
    5. signal-mask
    6. signal-masked?
    7. signal-mask!
    8. signal-unmask!
    9. Signal codes

Module (chicken process signal)

This module offers procedures for dealing with POSIX process signals.

Please note that signals are very POSIX-specific. Windows only supports rudimentary in-process signals for dealing with user interrupts, segmentation violations, floating-point exceptions and the like. Inter-process signals are not supported. Therefore, most of the procedures here are not available on native Windows builds. If that's the case, the description contains a note.

set-alarm!

[procedure] (set-alarm! SECONDS)

Sets an internal timer to raise the signal/alrm after SECONDS are elapsed. You can use the set-signal-handler! procedure to write a handler for this signal.

NOTE: On native Windows builds (all except cygwin), this procedure is unimplemented and will raise an error.

signal-handler

set-signal-handler!

[procedure] (signal-handler SIGNUM)

Returns the signal handler for the code SIGNUM or #f.

[procedure] (set-signal-handler! SIGNUM PROC)

Establishes the procedure of one argument PROC as the handler for the signal with the code SIGNUM. PROC is called with the signal number as its sole argument. If the argument PROC is #f then any signal handler will be removed, and the corresponding signal set to SIG_IGN.

Notes

set-signal-mask!

[procedure] (set-signal-mask! SIGLIST)

Sets the signal mask of the current process to block all signals given in the list SIGLIST. Signals masked in that way will not be delivered to the current process.

NOTE: On native Windows builds (all except cygwin), this procedure is unimplemented and will raise an error.

signal-mask

[procedure] (signal-mask)

Returns the signal mask of the current process.

NOTE: On native Windows builds (all except cygwin), this procedure is unimplemented and will raise an error.

signal-masked?

[procedure] (signal-masked? SIGNUM)

Returns whether the signal for the code SIGNUM is currently masked.

NOTE: On native Windows builds (all except cygwin), this procedure is unimplemented and will raise an error.

signal-mask!

[procedure] (signal-mask! SIGNUM)

Masks (blocks) the signal for the code SIGNUM.

NOTE: On native Windows builds (all except cygwin), this procedure is unimplemented and will raise an error.

signal-unmask!

[procedure] (signal-unmask! SIGNUM)

Unmasks (unblocks) the signal for the code SIGNUM.

NOTE: On native Windows builds (all except cygwin), this procedure is unimplemented and will raise an error.

Signal codes

[constant] signal/term
[constant] signal/kill
[constant] signal/int
[constant] signal/hup
[constant] signal/fpe
[constant] signal/ill
[constant] signal/segv
[constant] signal/abrt
[constant] signal/trap
[constant] signal/quit
[constant] signal/alrm
[constant] signal/vtalrm
[constant] signal/prof
[constant] signal/io
[constant] signal/urg
[constant] signal/chld
[constant] signal/cont
[constant] signal/stop
[constant] signal/tstp
[constant] signal/pipe
[constant] signal/xcpu
[constant] signal/xfsz
[constant] signal/usr1
[constant] signal/usr2
[constant] signal/bus
[constant] signal/winch
[constant] signal/break
[constant] signals-list

These variables contain signal codes for use with process-signal, set-signal-handler!, signal-handler, signal-masked?, signal-mask!, or signal-unmask!.

NOTE: On native Windows builds (all except cygwin), only signal/term, signal/int, signal/fpe, signal/ill, signal/segv, signal/abrt, signal/break have an actual value. The others are all defined as zero, because those signals don't exist on Windows.

NOTE: On UNIX builds and cygwin, signal/break is defined as zero because it only exists on Windows.

To get a list of signals that are known to exist on the current platform, you can check signals-list which is a list of integers (signal numbers).


Previous: Module (chicken process)

Next: Module (chicken process-context)